<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML>
<html>
<head>

    <title>职位详情</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="Hosting Store Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
    <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
    <link href="${pageContext.request.contextPath}/static/home/css/bootstrap.css" rel='stylesheet' type='text/css' />
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="${pageContext.request.contextPath}/static/home/js/jquery-1.11.1.min.js"></script>
    <!-- Custom Theme files -->
    <link href="${pageContext.request.contextPath}/static/home/css/style.css" rel='stylesheet' type='text/css' />

    <link href='${pageContext.request.contextPath}/static/home/css/font-awesome.css' rel='stylesheet' type='text/css'/>
    <link href="${pageContext.request.contextPath}/static/admin/css/sweetalert.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/home/css/resume_manage.css" rel='stylesheet' type='text/css' />
    <!-- Custom Theme files -->
    <!-- webfonts -->
    <!-- webfonts -->
    <!-- dropdown -->
    <script src="${pageContext.request.contextPath}/static/home/js/jquery.easydropdown.js"></script>
    <link href="${pageContext.request.contextPath}/static/home/css/nav.css" rel="stylesheet" type="text/css" media="all"/>
    <link href="${pageContext.request.contextPath}/static/home/css/job_detail_v1.0.css" rel="stylesheet" type="text/css"/>
    <link href="${pageContext.request.contextPath}/static/admin/assets/css/vendor/bootstrap/bootstrap.min.css" rel="stylesheet"/>
    <link href="${pageContext.request.contextPath}/static/home/css/job_management_table.css" rel="stylesheet">
    <!-- start-smoth-scrolling -->
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/home/js/move-top.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/home/js/easing.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/home/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/admin/js/sweetalert.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/admin/js/page.js"></script>

    <script type="text/javascript">
        jQuery(document).ready(function($) {
            $(".scroll").click(function(event){
                event.preventDefault();
                $('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
            });
        });
    </script>


    <!-- end-smoth-scrolling -->
    <style>
         input[type="button"] {
            background:#1BBC9B;
            color: #FFF;
            font-size: 1.2em;
            padding: 0.6em 2em;
            transition: 0.5s all;
            -webkit-transition: 0.5s all;
            -moz-transition: 0.5s all;
            -o-transition: 0.5s all;
            display: inline-block;
            text-transform: uppercase;
            border:none;
            outline:none;
        }
         input[type="button"]:hover {
            background:#000;
        }
    </style>
</head>
<!-- Header Starts Here -->
<div class="banner inner-banner" >
    <%@include file="../header.jsp"%>
    <!-- page heading -->
    <div id="breadcrumb_wrapper">
        <div class="container">

            <h3><strong>职位详情</strong></h3>
            <h6>&nbsp;</h6>

            <div class="clearfix"></div>
        </div>
    </div>
</div>
<div class="clearfix"> </div>
<!-- Header Ends Here -->

<div class="contact background">
    <div class="container">
        <div class="company">
            <div class="company-frame">
                <div class="read">
                    <!--职位名称-->
                    <div class="company-sm-frame">
                        <input type="text" id="input01" class="dark-green big larger left" readonly value="${job.job_name}"/>
                        <!--企业用户浏览职位详情时申请职位按钮应不可见-->
                        <%--<a href="${pageContext.request.contextPath}/home/job/edit.action?job_id=${job.job_id}"><input type="button" class="button" value="编辑"></a>--%>
                        <a href="#myModal" class="send" data-toggle="modal"><input type="button" class="button" value="申请职位"></a>
                    </div>
                    <div class="company-sm-frame">
                        <span style="margin-left: 39px;color: dimgray"><small>${job.address}</small></span>
                    </div>
                    <div class="company-sm-frame">
                        <!--月薪-->
                        <c:if test="${job.show_salary==0}">
                            <input type="text" id="input02" class="red larger zone" readonly value="面议"/>
                        </c:if>
                        <c:if test="${job.show_salary==1}">
                            <input type="text" id="input02" class="red larger zone" readonly value="${job.salaryType.value}"/>
                        </c:if>
                        <label class="zone40">|</label>
                        <!--发布地点-->
                        <input type="text" class="zone140" id="input03" readonly value="${job.zone.name}"/>
                        <input type="text" class="zone140" id="input04" readonly value="${job.city.name}"/>
                        <%--<label class="zone40">|</label>--%>
                        <br>
                        <!--职位性质-->
                        <input type="text" id="input05" class="zone120" readonly value="${job.jobProperty.job_property_name}"/>
                        <label class="zone40">|</label>
                        <!--招聘要求-->
                        <input type="text" class="zone120" id="input06" readonly value="${job.degree.degree_name}"/>
                        <label class="zone40">|</label>
                        <c:if test="${job.work_year==0}">
                            <input type="text" class="zone120" id="input07" readonly value="经验不限"/>
                        </c:if>
                        <c:if test="${job.work_year==1}">
                            <input type="text" class="zone120" id="input07" readonly value="一年以上"/>
                        </c:if>
                        <c:if test="${job.work_year==2}">
                            <input type="text" class="zone120" id="input07" readonly value="两年以上"/>
                        </c:if>
                        <c:if test="${job.work_year==3}">
                            <input type="text" class="zone120" id="input07" readonly value="三年以上"/>
                        </c:if>
                        <c:if test="${job.work_year==4}">
                            <input type="text" class="zone120" id="input07" readonly value="四年以上"/>
                        </c:if>
                        <c:if test="${job.work_year==5}">
                            <input type="text" class="zone120" id="input07" readonly value="五年以上"/>
                        </c:if>
                    </div>
                    <div class="company-sm-frame" style="margin-left: 30px" id="input08">
                        <!--职位标签-->

                        <c:forEach items="${jobTagList}" var="item1">
                            <c:forEach items="${tagToJobList}" var="item2">
                                <c:if test="${item2.tag_id==item1.job_tag_id}">
                                    <input type="text" class="tag" readonly value="${item1.job_tag_name}"/>
                                </c:if>
                            </c:forEach>
                        </c:forEach>

                    </div>
                </div>

                <div class= "read">
                    <!--职位介绍-->
                    <div class="company-sm-frame">
                        <input type="text" class="grey large big left" readonly value="职位介绍"/>
                        <textarea id="target" readonly class="form-control" >${job.job_description}</textarea>
                    </div>
                </div>
            </div>
            <div class="company-frame-right">
                <div class="read">
                    <div class="company-sm-frame">
                        <!--公司信息-->
                        <!--公司名称-->
                        <input type="text" id="input10" class="dark-green  larger" style="text-align: center; width: 90%" readonly value="${company.company_name}"/>
                        <!--行业-->
                        <label>行业</label>
                        <input type="text" id="input11" readonly value="${companyDetail.main_industry.industry_name}">
                        <!--规模-->
                        <label>规模</label>
                        <input type="text" id="input12" readonly value="${companyDetail.company_size.value}">
                        <!--性质-->
                        <label>性质</label>
                        <input type="text" id="input13" readonly value="${companyDetail.company_property.property_name}">
                        <a href="${pageContext.request.contextPath}/home/company/info_view.action?company_id=${company.company_id}"><input type="button" class="button" value="企业详情"></a>
                    </div>
                </div>

                <div class="read">
                    <div class="company-sm-frame">

                    </div>
                </div>
            </div>

            <div class="clearfix"> </div>
            <div class="company-form">
                <!--<form>-->
                <!--<input type="submit" class="btn-link">-->


                <!--个人用户搜索职位时编辑按钮应不可见-->
                <%--<span style="margin: 0 42%">--%>
                    <%--<a href="${pageContext.request.contextPath}/home/customer/notice.action"><input type="button" class="button" value="返回"></a>--%>
                <%--</span>--%>
                <!--</form>-->
            </div>
            <br><br>
        </div>

        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog" style="width:80%;">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel">选取一份简历</h4>
                    </div>
                    <div class="modal-body">
                        <div class="tab-content">
                            <div class="tile-body color transparent-black rounded-corners tab-pane fade in active ">
                                <div class="table-responsive">
                                    <table  class="table table-datatable table-custom basicDataTable">
                                        <thead>
                                        <tr>
                                            <th class="no-sort">标签</th>
                                            <th class="sort-amount">简历编号</th>
                                            <th class="sort-amount">应聘工作</th>
                                            <th class="sort-numeric">薪资范围</th>
                                            <th class="sort-numeric">工作地点</th>
                                            <th class="sort-numeric">最新修改日期</th>
                                        </tr>
                                        </thead>
                                        <tbody>

                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <div class="tile-footer bg-transparent-black-2 rounded-bottom-corners">
                                <div class="row">

                                    <div class="col-sm-offset-4 col-sm-4 text-center">
                                        <small class="inline table-options paging-info"></small>
                                    </div>

                                    <div class="col-sm-4 text-right sm-center">
                                        <ul class="pagination pagination-xs nomargin pagination-custom">

                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button id="confirm" onclick="sendResume()" type="button" class="btn btn-primary" style="background:#1BBC9B; border:none;">确定</button>
                    </div>
                </div><!-- /.modal-content -->
            </div>
        </div>
    </div>
</div>

<%--<div class="container" style="width:1100px;">--%>
    <%--<div class="view_resume">--%>
        <%--<h3>职位名称</h3>--%>
        <%--<h4><br></h4>--%>
        <%--<div class="resume_body">--%>
            <%--<!-- 职位性质 -->--%>
            <%--<div class="resume_group" id="name" style="float: left; width: 45%;">--%>
                <%--<div class="resume_title" style="width:30%;">--%>
                    <%--<h4>职位名称</h4>--%>
                <%--</div>--%>
                <%--<div class="resume_info" style="width:60%;">--%>
                    <%--<p>${job.job_name}</p>--%>
                <%--</div>--%>
                <%--<div class="clearfix"></div>--%>
            <%--</div>--%>

            <%--<!-- 职位名称 -->--%>
            <%--<div class="resume_group" id="sex" style="float: left; width: 45%;">--%>
                <%--<div class="resume_title" style="width:30%;">--%>
                    <%--<h4>职位性质</h4>--%>
                <%--</div>--%>
                <%--<div class="resume_info" style="width:60%;">--%>
                    <%--<p>${job.jobProperty.job_property_name}</p>--%>
                <%--</div>--%>
                <%--<div class="clearfix"></div>--%>
            <%--</div>--%>

            <%--<!-- 职位描述 -->--%>
            <%--<div class="resume_group" id="comment" style="width: 93%;">--%>
                <%--<div class="resume_title" style="width: 14%;">--%>
                    <%--<h4>职位描述</h4>--%>
                <%--</div>--%>
                <%--<div class="resume_info" style="width: 83%;">--%>
                    <%--<textarea readonly>${job.job_description}</textarea>--%>
                <%--</div>--%>
                <%--<div class="clearfix"></div>--%>
            <%--</div>--%>

            <%--<!-- 职位标签 -->--%>
            <%--<div class="resume_group" id="sex">--%>
                <%--<div class="resume_title">--%>
                    <%--<h4>职位标签</h4>--%>
                <%--</div>--%>
                <%--<div class="resume_info">--%>
                    <%--<p><c:forEach items="${jobTagList}" var="item1"><c:forEach items="${tagToJobList}" var="item2"><c:if test="${item2.tag_id==item1.job_tag_id}">${item1.job_tag_name}  </c:if></c:forEach></c:forEach> </p>--%>
                <%--</div>--%>
                <%--<div class="clearfix"></div>--%>
            <%--</div>--%>

            <%--<!-- 职位类别 -->--%>
            <%--<div class="resume_group" id="sex">--%>
                <%--<div class="resume_title">--%>
                    <%--<h4>职位类别</h4>--%>
                <%--</div>--%>
                <%--<div class="resume_info">--%>
                    <%--<p>${industryName} ${job.jobType.job_type_name}</p>--%>
                <%--</div>--%>
                <%--<div class="clearfix"></div>--%>
            <%--</div>--%>

            <%--<!-- 发布地点 -->--%>
            <%--<div class="resume_group" id="sex">--%>
                <%--<div class="resume_title">--%>
                    <%--<h4>发布地点</h4>--%>
                <%--</div>--%>
                <%--<div class="resume_info">--%>
                    <%--<p>${job.zone.name}${job.city.name}</p>--%>
                <%--</div>--%>
                <%--<div class="clearfix"></div>--%>
            <%--</div>--%>

            <%--<!-- 发布地址 -->--%>
            <%--<div class="resume_group" id="comment" style="width: 93%;">--%>
                <%--<div class="resume_title" style="width: 14%;">--%>
                    <%--<h4>发布地址</h4>--%>
                <%--</div>--%>
                <%--<div class="resume_info" style="width: 83%;">--%>
                    <%--<textarea readonly style="height: 50px;">${job.address}</textarea>--%>
                <%--</div>--%>
                <%--<div class="clearfix"></div>--%>
            <%--</div>--%>

            <%--<!-- 招聘人数 -->--%>
            <%--<div class="resume_group" id="sex">--%>
                <%--<div class="resume_title">--%>
                    <%--<h4>招聘人数</h4>--%>
                <%--</div>--%>
                <%--<div class="resume_info">--%>
                    <%--<p>${job.number}</p>--%>
                <%--</div>--%>
                <%--<div class="clearfix"></div>--%>
            <%--</div>--%>

            <%--<!-- 学历要求 -->--%>
            <%--<div class="resume_group" id="sex">--%>
                <%--<div class="resume_title">--%>
                    <%--<h4>学历要求</h4>--%>
                <%--</div>--%>
                <%--<div class="resume_info">--%>
                    <%--<p>${job.degree.degree_name}</p>--%>
                <%--</div>--%>
                <%--<div class="clearfix"></div>--%>
            <%--</div>--%>

            <%--<!-- 薪酬待遇 -->--%>
            <%--<div class="resume_group" id="sex">--%>
                <%--<div class="resume_title">--%>
                    <%--<h4>薪酬待遇</h4>--%>
                <%--</div>--%>
                <%--<div class="resume_info">--%>
                    <%--<p>${job.salaryType.value}</p>--%>
                <%--</div>--%>
                <%--<div class="clearfix"></div>--%>
            <%--</div>--%>

            <%--<!-- 发布时间 -->--%>
            <%--<div class="resume_group" id="sex">--%>
                <%--<div class="resume_title">--%>
                    <%--<h4>发布时间</h4>--%>
                <%--</div>--%>
                <%--<div class="resume_info">--%>
                    <%--<p>${job.date_start_string}</p>--%>
                <%--</div>--%>
                <%--<div class="clearfix"></div>--%>
            <%--</div>--%>

           <%--<div style="margin-left: 40%;margin-top: 20px">--%>
               <%--<a href="#myModal" class="send" data-toggle="modal"><input type="button" value="投递简历"></a>--%>
           <%--</div>--%>





        <%--</div>--%>
    <%--</div>--%>
    <%--&lt;%&ndash;<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">&ndash;%&gt;--%>
        <%--&lt;%&ndash;<div class="modal-dialog" style="width:80%;">&ndash;%&gt;--%>
            <%--&lt;%&ndash;<div class="modal-content">&ndash;%&gt;--%>
                <%--&lt;%&ndash;<div class="modal-header">&ndash;%&gt;--%>
                    <%--&lt;%&ndash;<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>&ndash;%&gt;--%>
                    <%--&lt;%&ndash;<h4 class="modal-title" id="myModalLabel">选取一份简历</h4>&ndash;%&gt;--%>
                <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
                <%--&lt;%&ndash;<div class="modal-body">&ndash;%&gt;--%>
                    <%--&lt;%&ndash;<div class="tab-content">&ndash;%&gt;--%>
                        <%--&lt;%&ndash;<div class="tile-body color transparent-black rounded-corners tab-pane fade in active ">&ndash;%&gt;--%>
                            <%--&lt;%&ndash;<div class="table-responsive">&ndash;%&gt;--%>
                                <%--&lt;%&ndash;<table  class="table table-datatable table-custom basicDataTable">&ndash;%&gt;--%>
                                    <%--&lt;%&ndash;<thead>&ndash;%&gt;--%>
                                    <%--&lt;%&ndash;<tr>&ndash;%&gt;--%>
                                        <%--&lt;%&ndash;<th class="no-sort">标签</th>&ndash;%&gt;--%>
                                        <%--&lt;%&ndash;<th class="sort-amount">简历编号</th>&ndash;%&gt;--%>
                                        <%--&lt;%&ndash;<th class="sort-amount">应聘工作</th>&ndash;%&gt;--%>
                                        <%--&lt;%&ndash;<th class="sort-numeric">薪资范围</th>&ndash;%&gt;--%>
                                        <%--&lt;%&ndash;<th class="sort-numeric">工作地点</th>&ndash;%&gt;--%>
                                        <%--&lt;%&ndash;<th class="sort-numeric">最新修改日期</th>&ndash;%&gt;--%>
                                    <%--&lt;%&ndash;</tr>&ndash;%&gt;--%>
                                    <%--&lt;%&ndash;</thead>&ndash;%&gt;--%>
                                    <%--&lt;%&ndash;<tbody>&ndash;%&gt;--%>

                                    <%--&lt;%&ndash;</tbody>&ndash;%&gt;--%>
                                <%--&lt;%&ndash;</table>&ndash;%&gt;--%>
                            <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
                        <%--&lt;%&ndash;</div>&ndash;%&gt;--%>

                        <%--&lt;%&ndash;<div class="tile-footer bg-transparent-black-2 rounded-bottom-corners">&ndash;%&gt;--%>
                            <%--&lt;%&ndash;<div class="row">&ndash;%&gt;--%>

                                <%--&lt;%&ndash;<div class="col-sm-offset-4 col-sm-4 text-center">&ndash;%&gt;--%>
                                    <%--&lt;%&ndash;<small class="inline table-options paging-info"></small>&ndash;%&gt;--%>
                                <%--&lt;%&ndash;</div>&ndash;%&gt;--%>

                                <%--&lt;%&ndash;<div class="col-sm-4 text-right sm-center">&ndash;%&gt;--%>
                                    <%--&lt;%&ndash;<ul class="pagination pagination-xs nomargin pagination-custom">&ndash;%&gt;--%>

                                    <%--&lt;%&ndash;</ul>&ndash;%&gt;--%>
                                <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
                            <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
                        <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
                    <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
                <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
                <%--&lt;%&ndash;<div class="modal-footer">&ndash;%&gt;--%>
                    <%--&lt;%&ndash;<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>&ndash;%&gt;--%>
                    <%--&lt;%&ndash;<button id="confirm" onclick="sendResume()" type="button" class="btn btn-primary" style="background:#1BBC9B; border:none;">确定</button>&ndash;%&gt;--%>
                <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
            <%--&lt;%&ndash;</div><!-- /.modal-content -->&ndash;%&gt;--%>
        <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
    <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
<%--</div>--%>

<table id="table_td_temp" style="display:none">
    <tbody id="template-list-tbody">
    <tr class="even gradeC">
        <td><input value="" type="radio" name="resume"/></td>
        <td>Number</td>
        <td>Job</td>
        <td>Salary</td>
        <td>Place</td>
        <td>Time</td>
    </tr>
    </tbody>
</table>
<!-- #Testimonials -->
<!-- /#Testimonials -->
<!-- #Footer -->
<%@include file="../footer.jsp"%>


<!-- //here ends scrolling icon -->
<script type="text/javascript">



    $(document).ready(function() {
        /*
         var defaults = {
         containerID: 'toTop', // fading element id
         containerHoverID: 'toTopHover', // fading element hover id
         scrollSpeed: 1200,
         easingType: 'linear'
         };
         */

        $().UItoTop({ easingType: 'easeOutQuart' });

    });


</script>
<script>

    var fetchData = function (furl) {
        var show = "";
        if(furl==null) {
            url = "${pageContext.request.contextPath}/home/job/getResumeList.action?p=1";
        }else{
            url = furl;
        }
        $.ajax({
            type:'get',
            url:url,
            success:function(json){

                show = json.show;
                if (show=="" ||show.totalRows == 0) {
                    $("#myModal table tbody").html('<tr><td colspan="10" align="center">暂无记录</td></tr>');
                    $('#myModal .paging-info').html("showing 0-0 of 0 items");
                    $('#myModal .pagination').html("");
                    return;
                } else {
                    var list = json.data;
                    var body = $("#myModal table tbody");
                    var temp_body = $('#template-list-tbody');
                    var tds = $('#table_td_temp td');
                    var string = "";
                    for (var i in list) {
                        $("#table_td_temp input").val(list[i].resume_id);
                        tds[1].innerHTML = list[i].serial_num;
                        tds[2].innerHTML = list[i].expect_job;
                        tds[3].innerHTML = list[i].salary_type.value;
                        tds[4].innerHTML = list[i].expect_city.zone.name+list[i].expect_city.name;
                        tds[5].innerHTML = list[i].date_modified_string;
                        string += temp_body.html();
                    }
                    body.html(string);
                    if(show.currentPage == show.totalPage){
                        $('#myModal .paging-info').html("showing "+(show.startIndex+1)+"-"+show.totalRows+" of "+show.totalRows+" items");
                    }else {
                        $('#myModal .paging-info').html("showing "+(show.startIndex+1)+"-"+show.endIndex+" of "+show.totalRows+" items");
                    }
                    make_page(show, '#myModal .pagination','?');
                }
            }
        });
    };
    fetchData();

    function sendResume() {
        var resume_id = $('input:radio[name=resume]:checked').val();
        console.log(resume_id);
        var job_id = ${job.job_id};
        console.log(job_id);
        $.ajax({
            type:'post',
            url:'${pageContext.request.contextPath}/home/job/sendResume.action',
            data:'resume_id='+resume_id+'&job_id='+job_id,
            success:function(data) {
                if (data == -1) {
                    swal("","简历已投递,无须重复投递","warning");
                }
                else if(data == 1){
                    swal("","投递成功！","success");
                }else{
                    swal("","服务器出错！","error");
                }
            }
        });
    }


    </script>
<script type="text/javascript">

    window.onload = function () {

        var text = $('textarea')[0];
        add(text);
        text.style.resize="none";//去掉textarea能拖拽放大/缩小高度/宽度功能

    };
    $(document).on("input propertychange change", "textarea", function (e) {

        var target = e.target;
        // 保存初始高度，之后需要重新设置一下初始高度，避免只能增高不能减低。
        var dh = $(target).attr('defaultHeight') || 0;
        if (!dh) {
            dh = target.clientHeight;
            $(target).attr('defaultHeight', dh);
        }

        target.style.height = dh +'px';
        var clientHeight = target.clientHeight;
        console.log(target.clientHeight);
        var scrollHeight = target.scrollHeight;
        console.log(scrollHeight);
        if (clientHeight != scrollHeight) { target.style.height = scrollHeight + 10 + "px";
        }
    });

    function add(val) {
//        console.log("run");
//        console.log(val);
        val.style.height = val.scrollHeight + 10 + "px";
    }

</script>

</html>